/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// ppwdfld.hpp - Password entry field.
//
// Author: Kenneth G. Maxwell
//
//
// Copyright (c) 1997-1999 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/


#ifndef _PEGPASSWD_
#define _PEGPASSWD_

#define MAX_PASSWORD   120

class PegPasswordField : public PegEditField
{
    public:
        PegPasswordField(const PegRect &Rect,
                         const PEGCHAR *pText,
                         PEGUSHORT Id = 0,
                         PEGULONG Style = FF_RECESSED|AF_ENABLED|EF_EDIT,
                         PEGINT Len = MAX_PASSWORD - 1,
                         PEGCHAR EchoChar = '*');


        virtual PEGCHAR *DataGet(void);
        virtual PEGINT Message(const PegMessage &Mesg);
        void InitializeText(const PEGCHAR *pText);
        void EchoChar(PEGCHAR What) {mEchoChar = What;}
        PEGCHAR EchoChar(void) {return mEchoChar;}

    private:

        void DeleteMarkedPWText();
        void ReplaceMarkedPWText(PEGCHAR Key);

        PEGCHAR mText[120];     // max password is 119 chars !!!!
        PEGCHAR mEchoChar;

};

#endif






